package com.livesource.client.web.sourceCode.testing;

import com.google.gwt.user.client.ui.Label;
import com.livesource.client.model.entry.ProjectClass;
import com.livesource.client.web.LiveSourcePage;
import com.livesource.client.web.sourceCode.FeatureDescription;
import com.livesource.client.web.sourceCode.viewOptions.ButtonTest;
import com.livesource.client.web.sourceCode.viewOptions.OptionsIcons;

/**
 * Show the specification of the Test Class.
 * 
 * @Feature
 */
public class UnitTestView {

	public UnitTestView(ProjectClass classEntry, ProjectClass testEntry) {

		OptionsIcons.buttonTest.setHTML(ButtonTest.imagePressed);

		if (testEntry != null && testEntry.getFileContent() != null
				&& testEntry.getFileContent().length() > 0) {

			LiveSourcePage.featureVisualizationPanel.clear();

			LiveSourcePage.featureVisualizationPanel
					.add(new ButtonViewTestSourceCode(testEntry));

			Label labelSpace = new Label(" ");
			labelSpace.setHeight("10px");

			LiveSourcePage.featureVisualizationPanel.add(labelSpace);

			new FeatureDescription(testEntry);

		} else {

			LiveSourcePage.featureVisualizationPanel.clear();

			LiveSourcePage.featureVisualizationPanel.add(new NoTestFoundPanel(
					classEntry));
		}
	}
}
